package com.czkevin.guicontrolsapi.controls;

import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;

public class ItemDisplayControl extends AbstractSingleItemControl {

    private final ItemStack item;

    public ItemDisplayControl(ItemStack item) {
        this.item = item;
    }

    @Override
    protected ItemStack createDisplay() {
        return item;
    }

    @Override
    public void onClick(InventoryClickEvent event, int localX, int localY) {
        event.setCancelled(true);
    }

    @Override
    public int getWidth() {
        return 1;
    }

    @Override
    public int getHeight() {
        return 1;
    }
}
